package com.raymond.controller;

import com.alibaba.fastjson.JSONObject;
import com.raymond.entity.commons.BasisSupplierPageQueryReqVo;
import com.raymond.entity.commons.DtoResult;
import com.raymond.entity.commons.PageResponse;
import com.raymond.entity.commons.SupplierPageResponse;
import com.raymond.service.BasisSupplierService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * desc-供应商 控制器
 *
 * @author houmenghe
 * @date 2025/04/27 14:04
 **/
@Slf4j
@Api(tags = "供应商控制器:BasisSupplierController")
@RestController
@RequestMapping("/v1/supplier")
public class BasisSupplierController {

    @Autowired
    private BasisSupplierService basisSupplierService;

    @PostMapping("/querySupplierList")
    @ApiOperation(value = "查询供应商列表", notes = "查询供应商列表")
    public DtoResult<PageResponse<SupplierPageResponse>> querySupplierList(@RequestBody BasisSupplierPageQueryReqVo query) {
        log.info("查询供应商列表：请求参数：{}", JSONObject.toJSONString(query));
        return DtoResult.ok(basisSupplierService.querySupplierList(query));
    }
}
